package Week1.J0417;

import java.util.Scanner;

public class DivideTwo {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        long count = scanner.nextLong();
        long[] arr = new long[n];

        for (int i = 0; i < n; i++) {
            arr[i] = scanner.nextInt();
        }

        int maxI = 0;
        while (count > 0) {
            boolean flag = false;
            for (int i = 0; i < n; i++) {
                if (arr[i] % 2 == 0 && arr[i] >= arr[maxI]) {
                    maxI = i;
                    flag = true;
                }
            }
            if (flag) {
                arr[maxI] /= 2;
            }
            count--;
        }

        int sum = 0;
        for (int i = 0; i < n; i++) {
            sum += (int) arr[i];
        }

        System.out.println(sum);
    }
}
